﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="AddCreditCard.aspx.cs" Inherits="RBOSS.WebUI.AddCreditCard" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:PlaceHolder runat="server" ID="Message" Visible="false">
                        <p class="text-danger">
                            <asp:Literal runat="server" ID="MessageText" />
                        </p>
    </asp:PlaceHolder>
    <table>
        <tr>
            <td><asp:Label Text="Credit Card Type" runat="server"></asp:Label></td>
            <td><asp:DropDownList runat="server" ID="ddlCreditCard"/></td>
        </tr>
        <tr>
            <td><asp:Label runat="server" Text="Credit Card Number"></asp:Label></td>
            <td><asp:TextBox runat="server" ID="txtCreditCardNumber"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator runat="server" ValidationGroup="AddCreditCard"
                    ErrorMessage="Credit Card Number is Required!" 
                    ControlToValidate="txtCreditCardNumber">
                    </asp:RequiredFieldValidator>
            </td>
            <td>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"  ValidationGroup="AddCreditCard"
                ErrorMessage="Must be 16 ditits" ForeColor="Red" ControlToValidate="txtCreditCardNumber"
                ValidationExpression="^[0-9]{16}$"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label runat="server" Text="Name on Card"></asp:Label></td>
            <td><asp:TextBox runat="server" ID="txtNameOnCard"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator runat="server"  ValidationGroup="AddCreditCard"
                    ErrorMessage="Name is Required!" 
                    ControlToValidate="txtNameOnCard">
                    </asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label runat="server" Text="Expiration Date"></asp:Label></td>
            <td><asp:TextBox runat="server" ID="txtExpirationDate"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator runat="server" ControlToValidate="txtExpirationDate"  ValidationGroup="AddCreditCard"
                     ErrorMessage="Expired Date is required"></asp:RequiredFieldValidator>
    

                <asp:RequiredFieldValidator runat="server"  ValidationGroup="AddCreditCard"
                    ErrorMessage="Expiration Date is Required!" 
                    ControlToValidate="txtExpirationDate">
                    </asp:RequiredFieldValidator>
            </td>
            <td>
                
            </td>
        </tr>
        <tr>
            <td><asp:Label runat="server" Text="Pin"></asp:Label></td>
            <td><asp:TextBox runat="server" ID="txtPin"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator runat="server"  ValidationGroup="AddCreditCard"
                    ErrorMessage="Credit Card Number is Required!" 
                    ControlToValidate="txtPin">
                    </asp:RequiredFieldValidator>
            </td>
            <td>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server"  ValidationGroup="AddCreditCard"
                ErrorMessage="Must be 3 digits" ForeColor="Red" ControlToValidate="txtPin"
                ValidationExpression="^[0-9]{3}$"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label runat="server" Text="Address Line1"></asp:Label></td>
            <td><asp:TextBox runat="server" ID="txtAddressLine1"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator runat="server"  ValidationGroup="AddCreditCard"
                    ErrorMessage="Address Line1 is Required!" 
                    ControlToValidate="txtAddressLine1">
                    </asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label runat="server" Text="Address Line2"></asp:Label></td>
            <td><asp:TextBox runat="server" ID="txtAddressLine2"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator runat="server"  ValidationGroup="AddCreditCard"
                    ErrorMessage="Address Line2 is Required!" 
                    ControlToValidate="txtAddressLine2">
                    </asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label runat="server" Text="City"></asp:Label></td>
            <td><asp:TextBox runat="server" ID="txtCity"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator runat="server"  ValidationGroup="AddCreditCard"
                    ErrorMessage="City is Required!" 
                    ControlToValidate="txtCity">
                    </asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label runat="server" Text="State"></asp:Label></td>
            <td><asp:TextBox runat="server" ID="txtState"></asp:TextBox></td>
             <td>
                <asp:RequiredFieldValidator runat="server"  ValidationGroup="AddCreditCard"
                    ErrorMessage="State is Required!" 
                    ControlToValidate="txtState">
                    </asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label runat="server" Text="Zip"></asp:Label></td>
            <td><asp:TextBox runat="server" ID="txtZip"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator runat="server"  ValidationGroup="AddCreditCard"
                    ErrorMessage="Zip is Required!" 
                    ControlToValidate="txtZip">
                    </asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label runat="server" Text="Country"></asp:Label></td>
            <td><asp:TextBox runat="server" ID="txtCountry"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator runat="server"  ValidationGroup="AddCreditCard"
                    ErrorMessage="Country is Required!" 
                    ControlToValidate="txtCountry">
                    </asp:RequiredFieldValidator>
            </td>
        </tr>
    </table>
    
    <asp:Button runat="server" ID="btnAddCreditCard" OnClick="BtnAddCreditCardClick" ValidationGroup="AddCreditCard" Text="Add Credit Card"/>
    <br/>
    <asp:HyperLink ID="hlReturnToCustomerProfilePage" Visible = "False" runat="server" NavigateUrl="CustomerProfile.aspx">Return Back!!!</asp:HyperLink> 
</asp:Content>
